<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/user.css'
))); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper user" ng-controller="admin-user-detail-controller">
    <section class="content" style="display: block; height: 100%;">
        <div class="row">
            <div class="col-sm-9 left">
                <div class="bg">
                    <div class="bg-inner">
                        <div class="row">
                            <div class="col-xs-7">
                                <a href="###" class="avatar"><img ng-src="{{ detail.avatar }}" alt=""></a>
                                <div class="r-box">
                                    <div class="name">
                                        <span class="nickname" ng-bind="detail.nickName"></span>
                                        <small ng-bind="'ID: ' + detail.userId"></small>
                                    </div>
                                    <br>
                                    <p class="sub-name">加入时间: <span ng-bind="detail.lastTime"></span></p>
                                    <p class="sub-name">最后登录: <span ng-bind="detail.created"></span></p>
                                    <a href="" class="btn btn-sm btn-success btn-rounded">账号可用</a>
                                </div>
                            </div>
                            <div class="col-xs-5 summary">
                                <div class="row">
                                    <div class="col-xs-4 s text-center">
                                        <span class="h3 block font-bold">0</span>
                                        <small>下线</small>
                                    </div>
                                    <div class="col-xs-4 s text-center">
                                        <span class="h3 block font-bold" ng-bind="detail.score"></span>
                                        <small>积分</small>
                                    </div>
                                    <div class="col-xs-4 s text-center">
                                        <span class="h3 block font-bold" ng-bind="detail.amount_cny"></span>
                                        <small>钱包</small>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-3 right">
                <div class="r-s box box-widget widget-user-2">
                    <div class="box-footer no-padding">
                        <ul class="nav nav-stacked">
                            <li><a href="#">未发货 <span class="pull-right badge bg-blue">31</span></a></li>
                            <li><a href="#">未确认收货 <span class="pull-right badge bg-green">12</span></a></li>
                            <li><a href="#">申请提现 <span class="pull-right badge bg-aqua">5</span></a></li>
                            <li><a href="#">累积充值 <span class="pull-right badge bg-red">842</span></a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12 items">

                <ul class="menu nav nav-pills">
                    <li role="presentation" ng-class="{'active': tabType == 'profile'}"><a ng-click="switchTab('profile')" href="javascript:void(0);">个人资料</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'order'}"><a ng-click="switchTab('order')" href="javascript:void(0);">Ta 的订单</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'bbs'}"><a ng-click="switchTab('bbs')" href="javascript:void(0);">所有评论</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'collect'}"><a ng-click="switchTab('collect')" href="javascript:void(0);">所有收藏</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'level-1'}"><a ng-click="switchTab('level-1')" href="javascript:void(0);">一级分销</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'level-2'}"><a ng-click="switchTab('level-2')" href="javascript:void(0);">二级分销</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'cashin'}"><a ng-click="switchTab('cashin')" href="javascript:void(0);">充值记录</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'cashout'}"><a ng-click="switchTab('cashout')" href="javascript:void(0);">提现记录</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'money'}"><a ng-click="switchTab('money')" href="javascript:void(0);">钱包管理</a></li>
                    <li role="presentation" ng-class="{'active': tabType == 'address'}"><a ng-click="switchTab('address')" href="javascript:void(0);">收货地址</a></li>
                </ul>

                <div class="m-c">

                    <div class="u-content row" ng-show="tabType == 'money'">
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>账户金额</dt>
                                <dd class="text-red" ng-bind="detail.amount_cny"></dd>
                            </dl>
                        </div>
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>冻结资金</dt>
                                <dd ng-bind="detail.amountFreeze_cny"></dd>
                            </dl>
                        </div>
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>活动资金</dt>
                                <dd ng-bind="detail.amountUnLimit_cny"></dd>
                            </dl>
                        </div>
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>仅限购物</dt>
                                <dd ng-bind="detail.amountBuy_cny"></dd>
                            </dl>
                        </div>
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>取现申请</dt>
                                <dd ng-bind="detail.amountCashout_cny"></dd>
                            </dl>
                        </div>
                        <div class="col-xs-2 m-t">
                            <dl>
                                <dt>积分</dt>
                                <dd ng-bind="detail.score"></dd>
                            </dl>
                        </div>

                        <div class="col-xs-12" style="padding-left: 50px;">
                            <a href="###" class="btn btn-warning" style="margin-right: 15px;">管理资金</a>
                            <a href="###" class="btn btn-danger">管理资金</a>
                        </div>

                        <div class="col-xs-12" style="padding-left: 50px; padding-top: 30px;">
                            <h5>解释说明:</h5>
                            <ul>
                                <li>账户金额: 用户在该平台账户余额,账户金额 = 冻结资金 + 活动资金 + 仅限购物</li>
                                <li>冻结资金: 用户充值后,默认资金处理冻结状态,用户不允许消费,也不允许提现;</li>
                                <li>活动资金: 用户可自由支配资金,用户可随时取现和消费;</li>
                                <li>仅限购物: 该部分资金用户只可用于购买商品;</li>
                                <li>取现申请: 用户发起提现申请,需要后台管理人员进行审核,通过后直接转入用户账户（目前只支持转入用户微信账户）</li>
                            </ul>
                        </div>
                    </div>

                    <div class="u-content" ng-show="tabType == 'address' && !showEmpty">

                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 150px;" class="text-center">收货人</th>
                                <th style="width: 150px;" class="text-center">联系方式</th>
                                <th style="width: 150px;" class="text-center">创建时间</th>
                                <th style="" class="text-center">详情地址</th>
                                <th style="" class="text-center">是否默认</th>
                            </tr>
                            <tr ng-repeat="(key, list) in address">
                                <td class="text-center" ng-bind="list.addressId"></td>
                                <td class="text-center" ng-bind="list.name"></td>
                                <td class="text-center text-red" ng-bind="list.phone"></td>
                                <td class="text-center" ng-bind="list.created"></td>
                                <td class="text-center" ng-bind="list.province + ' ' + list.city + ' ' + list.area + ' ' + list.address"></td>
                                <td class="text-center" ng-bind="list.default ? '是' : '否'"></td>
                            </tr>
                        </table>

                    </div>

                    <div class="u-content" ng-show="tabType == 'cashin' && !showEmpty">

                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 150px;" class="text-center">套餐名称</th>
                                <th style="width: 150px;" class="text-center">充值金额</th>
                                <th style="width: 150px;" class="text-center">充值时间</th>
                                <th style="" class="text-center">申请终端</th>
                                <th style="" class="text-center">充值平台</th>
                            </tr>
                            <tr ng-repeat="(key, list) in cashin">
                                <td class="text-center" ng-bind="list.id"></td>
                                <td class="text-center" ng-bind="list.mealName"></td>
                                <td class="text-center text-red" ng-bind="list.amount_format"></td>
                                <td class="text-center" ng-bind="list.created"></td>
                                <td class="text-center" ng-bind="list.client == 'wx' ? '微信' : 'APP'"></td>
                                <td class="text-center" ng-bind="list.source == 'wechat' ? '微信支付' : '支付宝'"></td>
                            </tr>
                        </table>

                    </div>

                    <div class="u-content" ng-show="tabType == 'cashout' && !showEmpty">
                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 150px;" class="text-center">提现金额</th>
                                <th style="width: 150px;" class="text-center">申请时间</th>
                                <th style="" class="text-center">申请终端</th>
                                <th style="" class="text-center">状态</th>
                                <th style="" class="text-center">描述</th>
                            </tr>
                            <tr ng-repeat="(key, list) in cashout">
                                <td class="text-center" ng-bind="list.id"></td>
                                <td class="text-center text-red" ng-bind="list.amount_format"></td>
                                <td class="text-center" ng-bind="list.created"></td>
                                <td class="text-center" ng-bind="list.source == 'wx' ? '微信' : 'APP'"></td>
                                <td class="text-center" ng-bind="list.status"></td>
                                <td class="text-center" ng-bind="list.note || '--'"></td>
                            </tr>
                        </table>
                    </div>

                    <div class="u-content" ng-show="tabType == 'bbs' && !showEmpty">
                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 350px;" class="text-center">帖子内容</th>
                                <th style="width: 120px;" class="text-center">发布时间</th>
                                <th style="" class="text-center">评论数</th>
                                <th style="" class="text-center">喜欢</th>
                                <th style="" class="text-center">附件</th>
                                <th style="" class="text-center">查看</th>
                            </tr>
                            <tr ng-repeat="(key, list) in bbsLists">
                                <td class="text-center" ng-bind="list.bbsId"></td>
                                <td>
                                    <a href="/bbs/detail/index?bbsId={{ list.bbsId }}" ng-bind="list.content"></a>
                                </td>
                                <td class="text-center" ng-bind="list.created"></td>
                                <td class="text-center" ng-bind="list.comments"></td>
                                <td class="text-center" ng-bind="list.likes"></td>
                                <td class="text-center" ng-bind="list.attachment.thumb.length > 0 ? '包含' : '不包含'"></td>
                                <td class="text-center">
                                    <a href="/bbs/detail/index?bbsId={{ list.bbsId }}" class="btn btn-link btn-xs"><i class="fa fa-search"></i> 查看</a>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div class="u-content" ng-show="tabType == 'collect' && !showEmpty">
                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 140px;" class="text-center">缩略图</th>
                                <th style="width: 200px;" class="text-center">商品名称</th>
                                <th style="width: 200px;" class="text-center">商品描述</th>
                                <th style="" class="text-center">最低售价</th>
                                <th style="" class="text-center">最高售价</th>
                                <th style="" class="text-center">库存</th>
                                <th style="" class="text-center">已售</th>
                                <th style="" class="text-center">状态</th>
                            </tr>
                            <tr ng-repeat="(key, list) in collect">
                                <td class="text-center" ng-bind="list.goodsId"></td>
                                <td class="text-center">
                                    <img ng-src="{{ list.thumb }}"
                                         width="70"
                                         height="70"
                                         alt="">
                                </td>
                                <td class="text-center" ng-bind="list.goodsName"></td>
                                <td class="text-center" ng-bind="list.description"></td>
                                <td class="text-red text-center" ng-bind="'￥' + list.minPrice"></td>
                                <td class="text-red text-center" ng-bind="'￥' + list.maxPrice"></td>
                                <td class="text-center" ng-bind="list.stock"></td>
                                <td class="text-center" ng-bind="list.sold"></td>
                                <td class="text-center" ng-bind="list.status == 1 ? '在售' : '已下架'"></td>
                            </tr>
                        </table>
                    </div>

                    <div class="u-content" ng-show="tabType == 'profile' && !showEmpty">
                        <form class="form-horizontal">
                            <div class="box-body">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">用户ID:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.userId"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">昵称:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.nickName"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">真实姓名:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.trueName || '未填写'"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">联系方式:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.phone || '未填写'"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">注册来源:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.source == 'wx' ? '微信用户' : (detail.source == 'ios' ? '苹果客户端' : '安卓客户端')"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">注册时间:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.created"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最后登录时间:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.lastTime"></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">最后登录IP:</label>
                                    <div class="col-sm-10">
                                        <p class="form-control-static" ng-bind="detail.lastIp"></p>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>

                    <div ng-show="tabType == 'order' && !showEmpty" class="table-order u-content">
                        <table class="table table-bordered">
                            <tr>
                                <th class="text-center" style="width: 60px">#</th>
                                <th style="width: 140px;" class="text-center">订单号</th>
                                <th style="" class="text-center">支付金额</th>
                                <th style="" class="text-center">商品金额</th>
                                <th style="" class="text-center">物流费用</th>
                                <th class="text-center" style="width: 150px;">下单时间</th>
                                <th class="text-center">支付方式</th>
                                <th class="text-center">订单状态</th>
                            </tr>
                            <tr ng-repeat="(key, list) in order">
                                <td class="text-center" ng-bind="list.orderId"></td>
                                <td class="text-center"><a href="javascript:;" ng-bind="list.sn"></a></td>
                                <td class="text-red text-center" ng-bind="'￥' + list.totalPrice"></td>
                                <td class="text-red text-center" ng-bind="'￥' + list.goodsPrice"></td>
                                <td class="text-red text-center" ng-bind="'￥' + list.expressPrice"></td>
                                <td class="text-center" ng-bind="list.created"></td>

                                <td class="text-center">
                                    <span ng-class="{'text-green': list.payMode == 'online', 'text-red': list.payMode=='delivery'}" ng-bind="list.payMode == 'online' ? '在线支付' : '货到付款'"></span>
                                </td>
                                <td class="text-center">
                                                <span class="badge"
                                                      ng-class="{
                                                      'bg-green': list.status == 'Complete',
                                                      'bg-aqua': list.status == 'Dispatch',
                                                      'bg-light': list.status == 'Pendding',
                                                      'bg-yellow': list.status == 'Unpaid',
                                                      'bg-red': list.status == 'Returns' || list.status == 'Refund'
                                                      }"
                                                      ng-bind="list.formatStatus"></span>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div ng-hide="!showEmpty" class="empty">~暂无数据~</div>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array('js' => array(
    '/assets/admin/js/user/detail.js'
))); ?>
